package Yanxin.atguigu.yx.tablefuntion;


import Yanxin.atguigu.yx.util.IkUtil;
import org.apache.flink.table.annotation.DataTypeHint;
import org.apache.flink.table.annotation.FunctionHint;
import org.apache.flink.table.functions.TableFunction;
import org.apache.flink.types.Row;

import java.util.List;


@FunctionHint(output = @DataTypeHint("row<kw string>"))
public class IkAnalyzer extends TableFunction<Row> {

    public void eval(String keyword){
        List<String> keywordsplit = IkUtil.split(keyword,true);

        for (String kw : keywordsplit) {
            collect(Row.of(kw));
        }
    }

}
